﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainContent.aspx.cs" Inherits="CourseManager.View.MainContent" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>课程管理系统</title>
	<script type="text/javascript">
		var refreshTree = function (tree) {
			Ext.net.DirectMethods.Refresh({
				success: function (result) {
					var nodes = eval(result);
					if (nodes.length > 0) {
						tree.initChildren(nodes);
						tree.expandAll();
					}
					else {
						tree.getRootNode().removeChildren();
					}
				},
				eventMask: {
					showMask: true,
					minDely: 500,
					customTarget: "navPnl",
					msg: "请稍候..."
				}
			}
            );
		}

		function ShowContent(nid) {
			Ext.net.DirectMethods.ShowContent(nid, {
				success: function (result) {
				}
			});
		}
	</script>
</head>
<body>
	<form id="form1" runat="server">
	<ext:ResourceManager runat="server" ID="RM" />
	<ext:Viewport runat="server" ID="viewPort">
		<Items>
			<ext:BorderLayout runat="server" ID="bordlayout">
				<West Split="true" UseSplitTips="true" MaxWidth="200" CollapseMode="Mini" SplitTip="收缩/展开">
					<ext:TreePanel runat="server" ID="navPnl" Width="200" Header="true" Title="导航栏" Border="true"
						RootVisible="false" Icon="YcQuickPartsInsertFromOnline">
						<Tools>
							<ext:Tool Type="Refresh" Qtip="刷新" Handler="refreshTree(#{navPnl});" />
						</Tools>
						<Root>
							<ext:TreeNode NodeID="root0" Text="导航根节点" />
						</Root>
						<Listeners>
							<Click Handler="ShowContent(node.nid)" />
						</Listeners>
					</ext:TreePanel>
				</West>
				<Center>
					<ext:Panel ID="Content" runat="server" Title="&nbsp;" AutoScroll="true">
						<AutoLoad ShowMask="true" MaskMsg="正在加载，请稍候... " />
					</ext:Panel>
				</Center>
			</ext:BorderLayout>
		</Items>
	</ext:Viewport>
	</form>
</body>
</html>
